package com.javaException.demo;

public class Test {
    public static void main(String[] args) {
        System.out.println("开始");
        try {
            test();
        } catch (Exception e) {
            System.out.println("数组下标越界");
            e.printStackTrace();
        }
        System.out.println("结束");


    }


    /**
     * 有可能会有多个异常
     */
    public static void test() {

        int[] arr = {1, 2, 3, 4, 5};
        System.out.println(arr[5]);

        String str = "123m";
        int i = Integer.parseInt(str);
        System.out.println(i);

    }
}
